package com.base.invoke.exception;


import com.base.invoke.enums.ExCodeEnum;

/**
 * 统一异常返回类
 * @author coolpig
 * @date 2020-11-10
 */
public class CommException extends RuntimeException {

    private static final long serialVersionUID = -4800659913481662327L;

    private ExCodeEnum codeEnum;
    private String message;

    public CommException(ExCodeEnum codeEnum) {
        super(codeEnum.getMsg());
        this.codeEnum = codeEnum;
    }

    public CommException(ExCodeEnum codeEnum, String message) {
        super(message);
        this.codeEnum = codeEnum;
        this.message = message;
    }

    public CommException(String message) {
        super(message);
        this.message = message;
    }

    public ExCodeEnum getCodeEnum() {
        return this.codeEnum;
    }

    public void setCodeEnum(ExCodeEnum codeEnum) {
        this.codeEnum = codeEnum;
    }

    public String getMessage() {
        return this.message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
